﻿Imports System
Imports System.Collections.Generic
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
Imports OMANE.Modules.TauxGarantis.ViewModels

Namespace Views
    Partial Public Class ViewSynthese
        Public Sub New()
            MyBase.New()

            Me.InitializeComponent()

            ' Insert code required on object creation below this point.

            ''Dim geom As PathGeometry = basePath.Data
            ''geom.Figures(0).StartPoint = New Point( _
            ''    Math.Cos(0), _
            ''    Math.Sin(0))
            ''Dim segs As PolyLineSegment = geom.Figures(0).Segments(0)

            ''segs.Points.Clear()
            ''For i As Integer = 1 To 5
            ''    segs.Points.Add(New Point( _
            ''    Math.Cos(i * Math.PI / 3), _
            ''    Math.Sin(i * Math.PI / 3)))
            ''Next
        End Sub
    End Class

    'Public Class SynteseInfoPartToGeometryConverter
    '    Implements IValueConverter

    '    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
    '        Try
    '            If value Is Nothing Then Return Nothing
    '            Dim data As IEnumerable(Of SyntheseInfoPart) = value
    '            If data Is Nothing Then Return Nothing
    '            Dim ptcount As Integer = data.Count
    '            If ptcount < 3 Then Return Nothing

    '            Dim q = (From elt In data
    '                    Order By elt.Position
    '                    Select elt).ToList

    '            Dim size As Double = 1
    '            Try
    '                size = System.Convert.ChangeType(parameter, GetType(Double))

    '            Catch ex As Exception

    '            End Try
    '            Dim p = From elt In q
    '                    Select New Point( _
    '                        size * elt.Level * Math.Cos(CDbl(2) * q.IndexOf(elt) * Math.PI / ptcount), _
    '                        size * elt.Level * Math.Sin(CDbl(2) * q.IndexOf(elt) * Math.PI / ptcount))

    '            'Dim result As New PathGeometry

    '            'Dim fig As New PathFigure
    '            'fig.IsClosed = True
    '            'fig.StartPoint = p(0)

    '            'Dim segs As New PolyLineSegment
    '            'For i As Integer = 1 To p.Length - 1
    '            '    segs.Points.Add(p(i))
    '            'Next

    '            'fig.Segments.Add(segs)
    '            'result.Figures.Add(fig)

    '            'Return result
    '            Return New PointCollection(p.AsEnumerable)
    '        Catch ex As Exception
    '            Return Nothing
    '        End Try
    '    End Function

    '    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
    '        Throw New NotImplementedException()
    '    End Function
    'End Class
End Namespace